/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mamayukero.problem.environment.map;

import mamayukero.problem.environment.map.Const;
import java.util.ArrayList;

/**
 *
 * @author jetzer
 */
public class Matrix 
{
	private ArrayList<ArrayList<Character>> mMatrix;
	
	public Matrix() 
	{
		mMatrix = new ArrayList<ArrayList<Character>>();
		//setDefaultMatrix();
	}
	
	public char at(int x, int y)
	{
		return mMatrix.get(x).get(y);
	}
	
	public void set(int x, int y, char e)
	{
		mMatrix.get(x).set(y, e);
	}
	
	public void printMatrix()
	{
		for(ArrayList<Character> tRow : mMatrix)
		{
			for(Character e : tRow)
			{
				System.out.print(e.charValue() + " ");
			}
			System.out.println("");
		}
	}
	
	public void setDefaultMatrix()
	{
		int tRow,tCol;
		ArrayList<Character> tArr = new ArrayList<Character>();
		for(tRow=0;tRow<5;tRow++)
		{
			for(tCol=0;tCol<5;tCol++)
			{
				tArr.add(Const.MOVEABLE);
			}
			mMatrix.add(new ArrayList<Character>(tArr));
			tArr.clear();
		}
	}
	
	public void setRow(ArrayList<Character> pRow)
	{
		mMatrix.add(new ArrayList<Character>(pRow));	
	}
}
